import {createApp} from 'vue'
import App from './App.vue'
import ElementPlus from 'element-plus'
import 'element-plus/dist/index.css'
import * as ElementPlusIconsVue from '@element-plus/icons-vue'
import { createPinia } from 'pinia'
import router from './router'
import "@/api/mock.js"
import api from "@/api/api.js"


const pinia = createPinia()
const app = createApp(App)
for (const [key, component] of Object.entries(ElementPlusIconsVue)) {
	app.component(key, component)
}
// 使用provide/inject机制实现API全局注册
app.provide('api', api)

// // 保留原有的全局属性方式，确保兼容性
// app.config.globalProperties.$api = api
app.use(router).use(ElementPlus).use(pinia).mount('#app')
